<template>
  <div class="ub-f1" style="min-height:100%;background-color:#f2f2f2;overflow-x: hidden;">
    <div class="ub bg_w ub-ver padding-css2 go">
      <div class="ub border-botttom padding-css6">
        <div class="ub f14 color-main">
          <span class="flightAirLine">{{airNum}}</span>&nbsp;
        </div>
        <div class="ub f14 zt-666 ">
          <span class="beginDate">{{beginDate}}</span>&nbsp;
          <span class="beginDateWeek">{{beginDay}}</span>
        </div>
        <div class="ub f12 ub-f1 zt-666 ub-pe ub-ac context" @click="openrule(rule)">
          <span>退改签规则</span><img class="ub ub-ac margin-l-css2 img1" src="./list_info.png">
        </div>
      </div>
      <div class="ub padding-css5 f16 fontWei">
        <div class="ub ub-f1 ">
          <span class="beginDateTime">{{beginDateTime}}</span>
        </div>
        <div class="ub ub-f1 ub-pe">
          <span class="endDateTime">{{endDateTime}}</span>
        </div>
      </div>
      <div class="ub padding-css5">
        <div class="ub f14 divlr">
          <span class="beginCity">{{beginCity}}</span>
        </div>
        <div class="ub f12 ub-f1 zt-666 ub-ver ub-ac">
          <div class="ub flayto">{{flyTime}}</div>
          <div class="ub ub-fh">
            <img class="ub ub-pc img2" src="./flyto_line.png">
          </div>
          <div class="ub flayto" v-show="stopOverFlag">经停</div>
        </div>
        <div class="ub ub-pe f14 divlr">
          <span class="endCity">{{endCity}}</span>
        </div>
      </div>
      <div class="ub padding-css5 f12 zt-666">
        <div class="ub ub-f1 ">
          <span class="beginCityName">{{beginCityName}}</span>
        </div>
        <div class="ub ub-f1 ub-pe">
          <span class="endCityName">{{endCityName}}</span>
        </div>
      </div>
      <div class="ub padding-css5 f14 zt-666">
        <div class="ub ub-f1 luEat">{{luEat}}</div>
      </div>
    </div>
    <div class="ub division">
      <div class="round roundLeft"></div>
      <div class="ub-f1 web-width divisionDashed"></div>
      <div class="round roundRight"></div>
    </div>
    <div class="bg-F2EBF5 ptb3 ub f14">
      <div class="ub w100">
        <div class="ub ub-ac ub-f1  ub-ver">
          <div class="zt-666 ub">
            <span>成人票</span>
          </div>
          <div class="moneyColor ">
            ￥{{adtpri}}
          </div>
        </div>
        <div class="ub ub-ac ub-f1 cnnPrice-s  ub-ver" v-show="flights.searchOpt.cnn!=='0'">
          <div class="zt-666 ub">
            <span>儿童票</span>
          </div>
          <div class="moneyColor">
            ￥{{cnnpri}}
          </div>
        </div>
        <div class="ub ub-ac ub-f1 infPrice-s  ub-ver" v-show="flights.searchOpt.inf!=='0'">
          <div class="zt-666 ub">
            <span>婴儿票</span>
          </div>
          <div class="moneyColor">
            ￥{{infpri}}
          </div>
        </div>
        <div class="ub ub-ac ub-f1 ub-ver jijianranyou" @click="openrule2()">
          <div class="zt-666 ub ub-ac">
            <span id="jiry" class="">{{fyName}}</span><img class="ub ub-ac margin-l-css2 img1" src="./list_info.png">
          </div>
          <div class="moneyColor">
            ￥{{jijian}}+￥{{ranyou}}
          </div>
        </div>
      </div>
    </div>
    <div class="diw2 bg-color-main"></div>
    <div class="bordings ub ub-ver padding-css2 bg_w  margin-b-css2">
      <div class="ub ub-ac padding-css5">
        <div class="ub ub-f1">
          添加修改乘机人
        </div>
        <div class="ub ub-ac color-main addTransaction" @click="isPop5=!isPop5"><img class="vm img4" src="./add_fill.png">
          <span class="vm">添加乘机人</span>
        </div>
      </div>
      <div class="ub ub-ac padding-css">
        <div class="ub ub-f1 f12 zt-666 prsContent">您总共需要添加
          <span class="adt">{{flights.searchOpt.adt}}位成人</span>
          <span v-show="flights.searchOpt.cnn!=='0'" class="adt">{{flights.searchOpt.cnn}}位儿童</span>
          <span v-show="flights.searchOpt.inf!=='0'" class="adt">{{flights.searchOpt.inf}}位婴儿</span>
        </div>
      </div>
      <div class="ub bordinglist ub-ver padding-css6 passenger">
        <div v-for="(person,index) in passexngerList" v-if="person.isCheck" :key="index" class="ub airPerson">
          <div @click="removePs(person)" class="ub ub-ac ub-pc delete-btn"><img class="ub delete" src="./delete.png"></div>
          <div class="ub ub-ver ub-pc carMs">
            <div class="name f14">
              <span class="pName">{{person.piLname}}&nbsp;{{person.piFname}}</span>&nbsp;
              <span class="f14 grey pType">{{person.piType}}</span>
            </div>
            <div class="idCar f14 grey">
              <span class="pId">{{person.piNumberType}}: {{person.piNumber}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="ub ub-ver bg_w padding-css2 margin-b-css2">
      <div class="ub ub-ac padding-css6 border-botttom">
        <div class=" divlr">
          <span>联系人</span>
        </div>
        <input class="ub ub-f1 none-input contactsName f14" v-model="userLinkMan" placeholder="请输入联系人姓名">
      </div>
      <div class="ub ub-ac  padding-css6 border-botttom">
        <div class=" divlr">
          <span>手机号码</span>
        </div>
        <input class="ub ub-f1 none-input contactsPhone f14" v-model="userMobile" placeholder="请输入联系人电话">
      </div>
      <div class="ub ub-ac  padding-css6 border-botttom">
        <div class=" divlr">
          <span>电子邮箱</span>
        </div>
        <input class="ub ub-f1 none-input f14 contactsEmail" v-model="userLinkEmail" placeholder="请输入联系人邮箱">
      </div>
    </div>
    <div class="ub f12 padding-css3 bg_w agree">
      <div class="ub ub-f1">
        <span class="">我已阅读并同意《西部航空运输总条件》等</span>
        <br>
        <span class="color-main detaileds" @click="severText">各项服务条款</span>
      </div>
      <div class="ub ub-ac" @click="isAgree=!isAgree">
        <div class="ServerImg margin-t02 ServerImgs ub-img" :class="{'Agree':isAgree,'disAgree':!isAgree}"></div>
      </div>
    </div>
    <div class="bg_w airtick content-rule" data-control="FOOTER" id="Footer_airTicketOrder">
      <div class="ub-fh ub-fv ub ub-ac ">
        <div class="ub-f1 ub  f18 padding-css2">
          <div class="moneyColor fontWei ub-f1">
            ￥
            <span class="sum">{{priceCount+zhifuchuli}}</span>
          </div>
          <div class="color-B2B2B2 ub ub-ac detailed" @click="openrule3">
            <span class="f14">明细</span><img class="img4 ub ub-ac margin-l-css2 detailedUp" detailed="1" src="./arrow_up@2x.png">
          </div>
        </div>
        <div @click="next" class="bg-color-main ub ub-ver ub-ae  ub-pc colorWhite generateOrder">
          <div class="f12 margin-r-css1">
            下一步
          </div>
          <div class="margin-r-css1 f14" style="margin-top:5px">
            增值服务预订
          </div>
        </div>
      </div>
      <!--弹出层(机建和燃油的详情) -->
      <div id="div-none" class="div-noness uhide div-toumingdu"></div>
    </div>
    <div class="uinn pop1 ub-f1" v-show="isPop">
      <div class="closeIcon ub-img" @click="closePop"></div>
      <div class="bg_w popdata" v-html="popData"></div>
    </div>
    <div class="uinn pop1 ub-f1" v-show="isSeverPop">
      <div class="closeIcon ub-img" @click="closePop"></div>
      <div class="bg_w popdata" v-html="severData"></div>
    </div>
    <div class="pop2 ub-f1" v-show="isPop2">
      <div class="closeIcon ub-img closeIcon2" @click="closePop2"></div>
      <div class="pop2box">
        <div class="bg_w popdata">
          <div v-show="pics.adtjPrice&&pics.adthkPrice===0" class="ub ub-pj">
            <div>民航发展基金(CN)</div>
            <div class="moneyColor">￥{{pics.adtjPrice}}</div>
          </div>
          <div v-show="pics.adthkPrice" class="ub ub-pj">
            <div>航空税(OP)</div>
            <div class="moneyColor">￥{{pics.adthkPrice}}</div>
          </div>
          <div v-show="pics.adtfwPrice" class="ub ub-pj">
            <div>旅客服务费</div>
            <div class="moneyColor">￥{{pics.adtfwPrice}}</div>
          </div>
          <div v-show="pics.adtabPrice" class="ub ub-pj">
            <div>旅客安保服务费(OO)</div>
            <div class="moneyColor">￥{{pics.adtabPrice}}</div>
          </div>
          <div class="ub ub-pj">
            <div>燃油</div>
            <div class="moneyColor">￥{{ranyou}}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="pop3 ub-f1 ub ub-ver ub-pe f10" v-show="isPop3" @click="openrule3">
      <div class="closeIcon ub-img closeIcon2 uhide"></div>
      <div class="pop3box">
        <div class="bg_w popdata" style="border-radius:0">
          <div class="ub ptb2 resultRow web-width" v-show="flights.searchOpt.adt!=='0'">
            <div class="ticketType ub ub-ac">成人 票价</div>
            <div class="ticketCount orange ub ub-ac ub-pc">￥{{adtpri}}</div>
            <div class="ticketPrice  ub ub-ac ub-pe">×{{flights.searchOpt.adt}}</div>
          </div>
          <div class="ub ptb2 resultRow web-width">
            <div class="ticketType ub ub-ac">{{fyName}}<img class="img1 margin-l-css2 uhide" src="./list_info.png"></div>
            <div class="ticketCount orange ub ub-ac ub-pc ub-f1">￥{{jijianranyou}}</div>
            <div class="ticketPrice ub ub-ac ub-pe">×{{flights.searchOpt.adt}}</div>
          </div>
          <div class="ub ptb2 resultRow web-width" v-show="flights.searchOpt.cnn!=='0'">
            <div class="ticketType ub ub-ac">儿童 票价</div>
            <div class="ticketCount orange ub ub-ac ub-pc">￥{{cnnpri}}</div>
            <div class="ticketPrice  ub ub-ac ub-pe">×{{flights.searchOpt.cnn}}</div>
          </div>
          <div class="ub ptb2 resultRow web-width" v-show="jijianranyou_ertong!==0">
            <div class="ticketType ub ub-ac">{{fyName}}<img class="img1 margin-l-css2 uhide" src="./list_info.png"></div>
            <div class="ticketCount orange ub ub-ac ub-pc">￥{{jijianranyou_ertong}}</div>
            <div class="ticketPrice ub ub-ac ub-pe">×{{flights.searchOpt.cnn}}</div>
          </div>
          <div class="ub ptb2 resultRow web-width" v-show="flights.searchOpt.inf!=='0'">
            <div class="ticketType ub ub-ac">婴儿 票价</div>
            <div class="ticketCount orange ub ub-ac ub-pc">￥{{infpri}}</div>
            <div class="ticketPrice  ub ub-ac ub-pe">×{{flights.searchOpt.inf}}</div>
          </div>

          <div class="ub ptb2 resultRow web-width" v-show="zhifuchuli!==0">
            <div class="ticketType ub ub-ac" @click="yuchulipop">交易处理费<img class="img1 margin-l-css2" src="./list_info.png"></div>
            <div class="ticketCount orange ub ub-ac ub-pc">￥{{zhifuchuli}}</div>
            <div class="ticketPrice orange ub ub-ac ub-pe"></div>
          </div>
        </div>
      </div>
      <div class="temp"></div>
    </div>
    <div class="pop2 ub-f1 ub ub-ver ub-pe" v-show="isPop4" @click="yuchulipop">

      <div class="pop3box">
        <div class="closeIcon ub-img topp"></div>
        <div class="bg_w popdata" style="border-radius:0">
          <div class="f16">交易处理费:</div>
          <div class="pop4" v-html="pop4Data">

          </div>
        </div>
      </div>
    </div>

    <div id="layermbox2" v-show="isPop5" class="layermbox layermbox1" index="2">
      <div class="laymshade"></div>
      <div class="layermmain">
        <div class="section">
          <div class="layermchild  layermanim" style="position:fixed; bottom:0; left:0; width: 100%; border:none;">
            <div class="layermcont">
              <div class="bg_w">
                <div class="f14 ub bg-white ubb">
                  <div class="ub ub-f1 f12 padding-css2">
                    <div class="ub-f1 ub ub-ac no f16 zi zihei" @click="isPop5=!isPop5;cancelPS()">取消</div>
                    <div class="ub ub-ac ub-pe f12 grey zihei">已隐藏类型不符的乘机人</div>
                    <div class="ub-f1 ub ub-ac ub-pe yes f16 zi zihei" @click="isPop5=!isPop5;addPS()">确定</div>
                  </div>
                </div>
                <div class="ptb f14 ub ub-ver bg-white" id="passexngerList">
                  <div v-show="item.isShow" v-for="(item,index) in passexngerList" :key="index" class="ptb ub ub-ac web-width persons checked-btn" style="opacity: 1;">
                    <img @click="edit(item)" class="ub edit" src="./edit.png">
                    <div class="ub ub-f1 ub-ac addPerson" data-add="0">
                      <div class="ub-f1 ub ub-pc ub-ver">
                        <div class="ub-f1">
                          <span class="pName">{{item.piLname}}&nbsp;{{item.piFname}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
                          <span class="grey f12 pType">{{item.piType}}</span>
                        </div>
                        <div v-show="item.piType!=='婴儿'" class="ub-f1 f12 pId">{{item.piNumberType}}: {{item.piNumber}}</div>
                        <div v-show="item.piType==='婴儿'" class="ub-f1 f12 pId">{{"证件信息"}}: {{"暂无"}}</div>
                      </div>
                      <div :class="{'bcc':item.isCheck}" class="ub ub-ac ub-pc check" @click="checkPS(item)">
                        <img v-show="item.isCheck" class="ub gou" src="./form_option_tick.png">
                      </div>
                    </div>
                  </div>
                </div>
                <div class="ptb f18 ub bg-white addBtn" @click="addPas">
                  <div class="ptb ub ub-ac ub-pc web-width">
                    <div class="ub ub-ac ub-pc zi"><img class="ub" src="./add_fill.png">&nbsp;&nbsp;新增乘机人</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/ecmascript-6">
import { mapState } from 'vuex';
export default {
  created: function () {
    let self = this;
    self.$store.commit('changeHeader', { // 提交首页header
      left: '返回',
      right: '',
      middle: '机票信息',
      ifshow: true,
      leftAction: '-1',
      leftIcon: 'leftIcon',
      rightAction: '/home',
      rightIcon: 'homeIcon'
    });
    self.getData();
    self.getzhifufeiinfo();
    console.log(this.ishome.data)
    this.fyName = this.ishome.data ? '税费+燃油' : '基建+燃油';
  },
  data: function () {
    return {
      fyName: '',
      userLinkMan: '',
      userMobile: '',
      userLinkEmail: '',
      airNum: '',
      beginDate: '',
      beginDay: '',
      rule: '',
      beginDateTime: '',
      endDateTime: '',
      beginCity: '',
      flyTime: '',
      endCity: '',
      beginCityName: '',
      stopOverFlag: '',
      endCityName: '',
      luEat: '',
      isPop: false, // 退改签规则
      isSeverPop: false, // 服务条款
      isPop2: false, // 基建燃油规则
      isPop3: false, // 费用明细
      isPop4: false, // 交易处理费
      isPop5: false, // 乘机人
      popData: '',
      severData: '',
      pop4Data: '',
      pop5Data: '',
      jijian: '',
      ranyou: '',
      adtpri: '',
      cnnpri: '',
      infpri: '',
      priceCount: '',
      jijianranyou: '',
      jijianranyou_ertong: '',
      zhifuchuli: '',
      isAgree: false,
      passexngerList: [],
      // 提交时的成人 儿童 婴儿数组  存放piId
      adtArr: [],
      cnnArr: [],
      infArr: [],
      // 选择乘机人时的的各个人数
      adtNum: 0,
      cnnNum: 0,
      infNum: 0,
      uri: '',
      air: {},
      pics: {} // 所有费用
    }
  },
  components: {
  },
  methods: {
    edit: function (item) {
      if (!this.ishome.data) {
        let person = {
          pifname: item.piFname,
          pilname: item.piLname,
          pinumbertype: item.piNumberType,
          pinumber: item.piNumber,
          pibirthday: item.piBirthDay,
          pimobile: item.piMobile,
          piemail: item.piEmail,
          pitype: item.piType,
          piid: item.piId
        }
        // 编辑国内乘机人
        this.$store.commit('setPassenger', person)
        this.$router.push('/addPassenger')
      } else {
        let person = {
          pifname: item.piFname,
          pilname: item.piLname,
          pinumbertype: item.piNumberType,
          pinumber: item.piNumber,
          pibirthday: item.piBirthDay,
          pimobile: item.piMobile,
          piemail: item.piEmail,
          pitype: item.piYype,
          piid: item.piId,
          piexpirationdate: item.piExpirationDate,
          bak2: item.bak2,
          bak1: item.bak1,
          picountry: item.piCountry
        }
        // 编辑国内乘机人
        this.$store.commit('setPassenger', person)
        this.$router.push('/addPassenger_wai')
      }
    },
    severText: function () {
      this.getSeverinfo()
    },
    removePs: function (person) {
      person.isCheck = false;
    },
    cancelPS: function () {
      let self = this;
      self.adtArr = [];
      self.cnnArr = [];
      self.infArr = [];
      for (let i = 0; i < self.passexngerList.length; i++) {
        self.passexngerList[i].isCheck = false;
      }
    },
    next: function () {
      let self = this;
      self.$store.commit('setIfInit', false);
      if (self.adtArr.length !== parseInt(self.flights.searchOpt.adt)) {
        self.$store.dispatch('showTx', { text: '请选择乘机人' });
        return false;
      } else if (self.cnnArr.length !== parseInt(self.flights.searchOpt.cnn)) {
        self.$store.dispatch('showTx', { text: '请选择乘机人' });
        return false;
      } else if (self.infArr.length !== parseInt(self.flights.searchOpt.inf)) {
        self.$store.dispatch('showTx', { text: '请选择乘机人' });
        return false;
      }
      if (this.userLinkMan) {
        if (!this.$utils.regTest(this.userLinkMan, 'anyName', this)) {
          return;
        }
      } else {
        self.$store.dispatch('showTx', { text: '请填写联系人' });
        return;
      }
      if (this.userMobile) {
        if (!this.$utils.regTest(this.userMobile, 'phoneNum', this)) {
          return;
        }
      } else {
        self.$store.dispatch('showTx', { text: '请填写联系电话' });
        return;
      }
      if (this.userLinkEmail) {
        if (!this.$utils.regTest(this.userLinkEmail, 'email', this)) {
          return;
        }
      } else {
        self.$store.dispatch('showTx', { text: '请填写联系邮箱' });
        return;
      }
      if (!self.isAgree) {
        self.$store.dispatch('showTx', { text: '您尚未同意各项服务条款' });
        return false;
      };
      let passengerArr = self.adtArr.concat(self.cnnArr).concat(self.infArr);
      let content = {
        bindBag: 'false', // 是否是活动
        segmentIndex: '1', // 1 去程
        uri: self.uri,
        passengers: passengerArr,
        passexngerList: self.passexngerList, // 所有乘机人信息
        adtNum: self.adtArr.length, // 成人数量
        cnnNum: self.cnnArr.length, // 儿童数量
        infNum: self.infArr.length, // 婴儿数量
        jijian: self.jijianranyou, // 税费
        ranyou: self.ranyou, // 燃油
        jijianranyou_ertong: self.jijianranyou_ertong, // 儿童基建燃油
        zhifuchuli: self.zhifuchuli, // 交易处理费
        adtpri: self.adtpri, // 成人票价
        cnnpri: self.cnnpri, // 儿童票价
        infpri: self.infpri, // 婴儿票价
        priceCount: self.priceCount, // 总票价
        air: self.air, // 机票详情
        userLinkMan: this.userLinkMan, // 联系人
        userMobile: this.userMobile, // 联系电话
        userLinkEmail: this.userLinkEmail // 联系邮箱
      }
      console.log(content);
      self.$store.commit('setAirTicketOrder', content);
      this.$store.commit('setIsAirTicketOrder', true)
      this.$router.push('/addValue')
    },
    addPas: function () {
      if (!this.ishome.data) {
        this.$store.commit('setPassenger', null)
        this.$router.push('/addPassenger')
      } else {
        this.$store.commit('setPassenger', null)
        this.$router.push('/addPassenger_wai')
      }
    },
    closePop: function () {
      this.isSeverPop = false;
      this.isPop = false;
      this.popData = '';
    },
    closePop2: function () {
      this.isPop2 = !this.isPop2;
    },
    closePop3: function () {
      this.isPop3 = !this.isPop3;
    },
    openrule: function (data) {
      this.popData = data;
      this.isPop = !this.isPop;
    },
    openrule2: function () {
      this.isPop2 = !this.isPop2;
      if (this.isPop3) {
        this.isPop3 = !this.isPop3;
      }
    },
    yuchulipop: function () {
      this.isPop4 = !this.isPop4;
      if (this.isPop3) {
        this.isPop3 = !this.isPop3;
      }
    },
    openrule3: function () {
      this.isPop3 = !this.isPop3;
    },
    checkPS: function (item) {
      let self = this;
      self.adtNum = 0;
      self.cnnNum = 0;
      self.infNum = 0;
      for (let i = 0; i < self.passexngerList.length; i++) {
        if (self.passexngerList[i].isCheck) {
          switch (self.passexngerList[i].piType) {
            case '成人':
              self.adtNum++;
              break;
            case '儿童':
              self.cnnNum++;
              break;
            case '婴儿':
              self.infNum++;
              break;
          }
        }
      }
      if (item.isCheck) {
        switch (item.piType) {
          case '成人':
            self.adtNum--;
            break;
          case '儿童':
            self.cnnNum--;
            break;
          case '婴儿':
            self.infNum--;
            break;
        }
      }
      switch (item.piType) {
        case '成人':
          if (self.adtNum >= self.flights.searchOpt.adt) {
            self.$store.dispatch('showTx', { text: '成人选择已经达到上限' });
          } else {
            item.isCheck = !item.isCheck;
          }
          break;
        case '儿童':
          if (self.cnnNum >= self.flights.searchOpt.cnn) {
            self.$store.dispatch('showTx', { text: '儿童选择已经达到上限' });
          } else {
            item.isCheck = !item.isCheck;
          }
          break;
        case '婴儿':
          if (self.infNum >= self.flights.searchOpt.inf) {
            self.$store.dispatch('showTx', { text: '婴儿选择已经达到上限' });
          } else {
            item.isCheck = !item.isCheck;
          }
          break;
      }
    },
    addPS: function () {
      let self = this;
      // 数组初始化
      self.adtArr = [];
      self.cnnArr = [];
      self.infArr = [];
      let per = {}
      for (let i = 0; i < self.passexngerList.length; i++) {
        if (self.passexngerList[i].isCheck) {
          switch (self.passexngerList[i].piType) {
            case '成人':
              per = {
                piId: self.passexngerList[i].piId,
                piType: self.passexngerList[i].piType,
                piName: self.passexngerList[i].piName,
                piNumberType: self.passexngerList[i].piNumberType,
                piNumber: self.passexngerList[i].piNumber
              }
              self.adtArr.push(per);
              break;
            case '儿童':
              per = {
                piId: self.passexngerList[i].piId,
                piType: self.passexngerList[i].piType,
                piName: self.passexngerList[i].piName,
                piNumberType: self.passexngerList[i].piNumberType,
                piNumber: self.passexngerList[i].piNumber
              }
              self.cnnArr.push(per);
              break;
            case '婴儿':
              per = {
                piId: self.passexngerList[i].piId,
                piType: self.passexngerList[i].piType,
                piName: self.passexngerList[i].piName,
                piNumberType: self.passexngerList[i].piNumberType,
                piNumber: self.passexngerList[i].piNumber
              }
              self.infArr.push(per);
              break;
          }
        }
      }
      // 成人 儿童 婴儿数量
      /* let adt = self.flights.searchOpt.adt;
      let cnn = self.flights.searchOpt.cnn;
      let inf = self.flights.searchOpt.inf; */
    },
    getzhifufeiinfo: function () {
      let self = this;
      let content = {
        'isBill': 'false',
        'columnId': '150',
        'pageNo': '1',
        'pageSize': '10'
      }
      let data = this.$utils.getUserContent(content);
      this.$store.commit('showLoading');
      this.$http.post(this.$RS.helpCenterDetail, data).then(
        function (res) {
          // 响应成功回调
          res = res.body;
          if (res.code === 1000) {
            console.log(res)
            self.pop4Data = res.content.list[0].content;
          } else {
            this.$store.commit('closePop');
            this.$store.dispatch('showTx', { text: res.message });
          }
        },
        function (err) {
          this.$store.commit('closePop');
          // 响应错误回调
          this.$store.dispatch('showTx', { text: err.message || '网络错误，请重试' });
        }
      );
    },
    getSeverinfo: function () {
      let content = {
        'columnId': '129',
        'detail': '',
        'listTitle': '服务条款',
        'detailTitle': '',
        'newsTypeId': '',
        'firstDate': [],
        'secondDate': []
      }
      this.$store.commit('sethelpCenter', content);
      this.$router.push('/helpCenterList')
    },
    getData: function () {
      let self = this;
      let airData = self.flights.searchOpt.tic; // 获取当前航班
      let userInfo = this.loginData.userInfo;
      let index = [];
      index.push(airData.index)
      let home = self.ishome.data ? '2' : '1'
      let content = {
        'beginCity': self.flights.searchOpt.beginCity,
        'airCompanyId': airData.airCompanyId, // 航空公司id
        'searchId': airData.uri,
        'PiDomOrInt': home, // 是否是国际乘机人1-国内，2-国际
        'index': index,
        'appFrom': 'westAirH5',
        'userId': userInfo.userId
      }
      let data = this.$utils.getUserContent(content);
      data.headers.userId = userInfo.userId;
      data.headers.loginToken = userInfo.token.loginToken;
      data.content = {
        'beginCity': self.flights.searchOpt.beginCity,
        'airCompanyId': airData.airCompanyId, // 航空公司id
        'searchId': airData.uri,
        'PiDomOrInt': home, // 是否是国际乘机人1-国内，2-国际
        'index': index,
        'appFrom': 'westAirH5',
        'userId': userInfo.userId
      }
      self.$store.commit('showLoading');
      self.$http.post(self.$RS.findAirTrip, data).then(
        function (res) {
          // 响应成功回调
          self.$store.commit('closePop');
          res = res.body;
          if (res.code === 1000) {
            console.log(res)
            self.uri = res.content.go.uri;
            let air = res.content.go;
            self.air = air;
            let pir = res.content.price;
            self.pics = pir;
            console.log(self.pics)
            // 乘机人信息
            console.log(self.flights.searchOpt)
            for (let i = 0; i < res.content.passenger.length; i++) {
              res.content.passenger[i].isCheck = false; // 初始化选中状态
              // 根据选择的乘机人显示 可选人
              switch (res.content.passenger[i].piType) {
                case '成人':
                  self.flights.searchOpt.adt === '0' ? res.content.passenger[i].isShow = false : res.content.passenger[i].isShow = true;
                  break;
                case '儿童':
                  self.flights.searchOpt.cnn === '0' ? res.content.passenger[i].isShow = false : res.content.passenger[i].isShow = true;
                  break;
                case '婴儿':
                  self.flights.searchOpt.inf === '0' ? res.content.passenger[i].isShow = false : res.content.passenger[i].isShow = true;
                  break;
              }
            }
            if (!self.isAirTicketOrder.data) { // 判断是否是上个界面来的  不是的话用vuex数据
              self.passexngerList = res.content.passenger;
            } else {
              self.passexngerList = self.airTicketOrder.passengers.passexngerList;
              self.addPS() // 添加已选择的乘机人
            }
            self.airNum = air.flightAirLine + air.flightNum;
            self.beginDate = air.beginDate
            self.beginDay = self.getday((new Date(air.beginDate).getDay()))
            self.rule = air.rule
            self.beginDateTime = air.beginDateTime.substr(0, 5)
            self.endDateTime = air.endDateTime.substr(0, 5)
            self.beginCity = air.beginCityName[0]
            self.flyTime = air.durationTime
            self.endCity = air.endCityName[0]
            self.beginCityName = air.beginCityName[1]
            self.endCityName = air.endCityName[1]
            self.luEat = air.freeFood + ' | ' + air.freeBaggage
            // 交易处理费
            self.zhifuchuli = res.content.payHandle
            self.stopOverFlag = air.stopOverFlag
            // 票价
            self.adtpri = pir.adtPrice
            self.cnnpri = pir.cnnPrice
            self.infpri = pir.infPrice
            // 机建费 *人数
            self.jijianranyou = pir.adtjPrice + pir.adtrPrice; // 单价
            self.jijianranyou_ertong = pir.cnnjPrice + pir.cnnrPrice; // 单价
            self.jijian = pir.adtjPrice;
            self.ranyou = pir.adtrPrice;
            self.priceCount = pir.priceCount;
            // 联系人信息
            self.userLinkMan = res.content.user.userLinkMan;
            self.userMobile = res.content.user.userMobile;
            self.userLinkEmail = res.content.user.userLinkEmail;
          } else {
            self.$store.dispatch('showTx', { text: res.message || '网络错误，请重试' });
          }
        },
        function (err) {
          this.$store.commit('closePop');
          // 响应错误回调
          self.$store.dispatch('showTx', { text: err.message || '网络错误，请重试' });
        }
      );
    },
    getday: function (date) {
      switch (date) {
        case 0:
          return '周日';
          break;
        case 1:
          return '周一';
          break;
        case 2:
          return '周二';
          break;
        case 3:
          return '周三';
          break;
        case 4:
          return '周四';
          break;
        case 5:
          return '周五';
          break;
        case 6:
          return '周六';
          break;
      }
    }
  },
  computed: mapState(['loginData', 'flights', 'airTicketOrder', 'isAirTicketOrder', 'ishome'])
}
</script>
<style lang="stylus" scoped>
@import '../../stylus/base.styl';
@import '../../../static/zyh.styl';
.padding-css3
  padding: f_times(0.8);
.daysdiv2
  border-radius: f_times(1.6);
  color: white;
  background-color: #843D99;
  margin: 0 f_times(0.8);
  padding: f_times(0.4);
.img1
  width: f_times(0.9);
.fontWei
  font-weight: 600 !important;
.padding-css2
  padding: 0 f_times(0.8);
.bg-F2
  background-color: #F2F2F2;
.todaylist div
  height: f_times(3);
.jrdiv
  width: 25%;
.border-botttom
  border-bottom: 1px solid #EEEEEE;
.padding-css5
  padding: f_times(0.6) 0;
.padding-css6
  padding: f_times(0.5) 0;
.DateMoney
  margin-top: f_times(0.2);
.margin-css2
  margin-bottem: f_times(0.7) 0;
common.css:1, .ub-fh
  width: 100%;
.img012
  width: f_times(0.84);
.moneyColor
  color: #FF9D01;
.roundLeft
  left: f_times(-0.2);
.roundRight
  right: f_times(-0.2);
.divisionDashed
  height: 1px;
  border-bottom: 1px dashed #DDD;
.round
  position: absolute;
  background: #843D99;
  width: f_times(0.5);
  height: f_times(0.5);
  border-radius: 50%;
  top: f_times(-0.2);
  z-index: 2;
.img2
  width: 100%;
  height: f_times(0.2);
.zt-999
  color: #999;
.zt-666
  color: #666;
.f10
  font-size: f_times(0.7);
.f12
  font-size: f_times(0.8);
.f14
  font-size: f_times(1);
.f16
  font-size: f_times(1);
.mart05
  margin-top: f_times(0.5);
.border-radiuscss1
  border-radius: f_times(0.4);
.padding-css7
  padding: f_times(0.4) f_times(0.7) f_times(0.7);
.margin-css3
  margin: f_times(0.7) f_times(0.3) f_times(0.7) f_times(0.3);
.f18
  font-size: f_times(1.3);
.margin-l-css2
  margin-left: f_times(0.35);
.img3
  width: f_times(0.84);
.img4
  width: f_times(1.2);
.btn-yd
  color: white;
  width: f_times(4.2);
  height: f_times(1.9);
  margin-top: f_times(1.9);
  border-radius: 0.5rem;
.bg-moneyColor
  background-color: #FF9D01;
.rule
  margin-top: f_times(0.2);
.pop1
  background-color: rgba(0, 0, 0, 0.3);
  padding: f_times(2) f_times(1);
  position: fixed;
  top: 0;
  height: 100%;
  z-index: 9999;
.pop2
  background-color: rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 9999;
.pop3
  background-color: rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 999;
.pop2box
  padding: f_times(2) f_times(1);
  margin-top: f_times(10);
.pop3box
  bottom: 0;
.popdata
  border-radius: f_times(0.5);
  padding: f_times(1);
  height: 70%;
  overflow-y: scroll;
  font-size: f_times(1.05);
  line-height: f_times(1.3);
  margin-top: f_times(2.5);
.pop4
  font-size: f_times(1.05);
  line-height: f_times(1.5);
.closeIcon
  background-color: #FFF;
  background-image: url('./close_tips.png');
  height: f_times(2);
  width: f_times(2);
  position: absolute;
  right: f_times(0.5);
  z-index: 2;
  top: f_times(3.7);
  border-radius: 50%;
.closeIcon2
  top: f_times(13.5);
.color-main
  color: #843D99;
.divlr
  width: 35%;
.ptb3
  padding: f_times(0.35);
  0;
.bg-F2EBF5
  background-color: #F2EBF5;
.w100
  width: 100%;
.division
  position: relative;
.diw2
  width: 100%;
  height: f_times(0.4);
.bg-color-main
  background-color: #843D99;
.vm
  vertical-align: middle;
.margin-b-css2
  margin-bottom: f_times(0.3);
input
  background-color: #fff;
.margin-t02
  margin-top: f_times(0.14);
.ServerImgs
  width: f_times(1.3);
  height: f_times(1.3);
.Servertext
  font-size: f_times(1.05);
  line-height: f_times(1.5);
#Footer_airTicketOrder
  width: 100%;
  height: f_times(3);
  border-top: 1px solid #dedede;
.color-B2B2B2
  color: #B2B2B2;
.bg-color-main
  background-color: #843D99;
.generateOrder
  height: 100%;
  padding: 0 f_times(0.42);
  color: #FFF;
  background: #843D99;
.ticketType
  width: 40%;
.ticketCount
  width: 40%;
.ticketPrice
  width: 20%;
.orange
  color: #FFA317;
.ptb2
  height: f_times(2.8);
.web-width
  width: 99%;
  margin: 0 auto;
.disAgree
  background-image: url('./form_radio.png');
.Agree
  background-image: url('./form_tick@2x.png');
.layermbox
  position: relative;
  z-index: 19891014;
.laymshade
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
.layermmain, .laymshade
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
.layermchild
  text-align: left;
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
.layermbox1 .layermcont
  padding: 0;
  text-align: left;
.zi
  color: #843D99;
.zihei
  height: f_times(2.7);
.grey
  color: #A4A4A4;
#passexngerList
  max-height: f_times(18);
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding: f_times(0.5);
.ptb
  padding: f_times(0.5) 0;
.web-width
  width: 98%;
  margin: 0 auto;
.edit
  width: f_times(1.7);
  height: f_times(1.7);
.addPerson
  padding-left: f_times(0.7);
  height: f_times(2.3);
.check
  width: f_times(1.2);
  height: f_times(1.2);
  border: 1px solid #A4A4A4;
.ubb
  border-color: #dedede;
.addBtn img
  width: f_times(1.4);
  height: f_times(1.4);
.bcc
  border-color: rgb(132, 61, 153);
.temp
  height: f_times(3);
  background-color: transparent;
.airPerson
  padding: 0.5em 0.3em;
.delete
  width: f_times(1.7);
  height: f_times(1.7);
  padding-right: f_times(0.4);
.grey
  color: #A4A4A4;
.idCar
  margin-top: f_times(0.4);
.agree
  margin-bottom: f_times(3);
.topp
  top: f_times(2);
</style>